package com.hefei.customer.login.service.impl;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hefei.customer.login.dao.ILoginDao;
import com.hefei.customer.login.po.User;
import com.hefei.customer.login.service.ILoginService;
import com.hefei.service.framework.exception.DaoException;
import com.hefei.service.framework.exception.ServiceException;
@Service
public class LoginService implements ILoginService {
	
	private static Logger logger = Logger.getLogger(LoginService.class);
	@Autowired
	private ILoginDao loginDao;
	
	@Override
	public User getUserByname(String username) throws ServiceException {
		try {
			
			User user = loginDao.getByNameAndpassword(username);
			return user;
		} catch (DaoException e) {
			throw new ServiceException(e.getErrorCode());
		}
		
	}

}
